Release v1.2.0#708
Merged
Merged
Conversation
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 31, 2026
The v1.1.13 -> v1.2.0 inline-namespace rename (v1_1_13 -> v1_2_0) shortened the namespace string by one character. get_type_name() skips a hardcoded prefix length into __FUNCSIG__/__PRETTY_FUNCTION__, and that prefix includes the inline namespace on MSVC/GCC/IAR (clang elides it). The stale offsets made get_type_name<int>() return the wrong substring, failing test_type_traits (all compilers) and test_policies_logging (GCC). Adjust the affected offsets by -1: MSVC 65->64, GCC 69->68, IAR 72->71; clang (50/63) is namespace-length-independent and unchanged. GCC 68 matches the pre-1.1.10 value for a 6-char namespace. Verified: full ctest suite 68/68 on GCC (C++17); MSVC type_traits passes under msvc-wine (and fails at offset 65, confirming 64). Added a comment so the offsets are re-tuned on future namespace-length changes. Fixes CI on PR boost-ext#708 (ubuntu g++, windows MSVC).
- CHANGELOG: new entry covering flush_queue, clear_defer, deps policy, min-size default flip, and other behavior changes since v1.1.13 - overview: document config macros (min-size opt-in, exceptions, default- constructible deps) and the sizeof(sm) behavior change (boost-ext#249) - user_guide: add sm::flush_queue() (boost-ext#456) and sml::deps<Ts...> policy (boost-ext#437) - tutorial: document defer/clear_defer (boost-ext#643) and flush_queue usage - faq: seed with on_entry<_> multi-TU limitation (boost-ext#565) and operator, two-MFP limitation + wrap() workaround (boost-ext#389) make_action (boost-ext#629) intentionally omitted; it ships with open PR boost-ext#706.
Every example in the docs is verified to compile + run at -std=c++14 (GCC 14.3 locally in Docker, incl. SDL2 for sdl2.cpp; arduino compiles to an empty main without Arduino.h) and on Compiler Explorer (GCC 14.2). A 'Run on Compiler Explorer' link is added beside each ![CPP] embed across examples.md, tutorial.md, user_guide.md, index.md and overview.md (65 links total). Since Boost.SML is not a Compiler Explorer library, each link inlines sml.hpp (and dispatch_table.hpp where used); BOOST_SML_* config macros are hoisted above the header so they still apply (e.g. data.cpp). The error/* examples get compile-only links that show their intended diagnostic. Also fixes broken doc links: - user_guide.md: example/action_guards.cpp -> example/actions_guards.cpp (typo) - user_guide.md: example/errors/not_*.cpp -> test/ft/errors/not_*.cpp (wrong path) Adds doc/scripts/gen_godbolt_links.sh to regenerate the links reproducibly.
The in-page 'Compile & Run' buttons POSTed to http://melpon.org/wandbox (plain HTTP -> mixed-content blocked on the HTTPS site, and a dead host). - Repoint to https://wandbox.org/api/compile.json (alive; sends Access-Control-Allow-Origin: * so the cross-origin XHR works). - Drop the now-invalid 'boost-1.60' compile option (it makes the API reject the request; SML has no Boost dependency anyway). - Supply boost/sml/utility/dispatch_table.hpp alongside boost/sml.hpp so the dispatch_table and sdl2 examples also run. - Update the 'Powered by Wandbox' footer link to https://wandbox.org. Verified end-to-end against the live API at -std=c++14 (clang-head): hello_world, composite, data, transitions, dispatch_table and sdl2 all return status 0 (sdl2 prints its expected output).
- Run doc/scripts/update_readme_toc.py so the README's auto-generated table of contents reflects the new FAQ 'Limitations' section and the '[Unreleased] - since 1.1.13' CHANGELOG entry. - Adjust faq.md heading levels (page title -> h1) so the generator does not emit a redundant 'FAQ' child entry under the FAQ link.
Cut the next release. Minor bump (not patch): this release adds new public API (sm::flush_queue, sml::clear_defer, sml::deps<Ts...>) and changes observable behavior (empty-SM sizeof under boost-ext#249), so it is 1.2.0 per semver. - BOOST_SML_VERSION 1'1'13 -> 1'2'0; inline namespace v1_1_13 -> v1_2_0 - CMakeLists package version 1.1.13 -> 1.2.0 - CHANGELOG: finalize the entry as [1.2.0] - 2026-06-01 (compare link -> v1.2.0) - README: regenerate documentation TOC for the 1.2.0 changelog entry
The v1.1.13 -> v1.2.0 inline-namespace rename (v1_1_13 -> v1_2_0) shortened the namespace string by one character. get_type_name() skips a hardcoded prefix length into __FUNCSIG__/__PRETTY_FUNCTION__, and that prefix includes the inline namespace on MSVC/GCC/IAR (clang elides it). The stale offsets made get_type_name<int>() return the wrong substring, failing test_type_traits (all compilers) and test_policies_logging (GCC). Adjust the affected offsets by -1: MSVC 65->64, GCC 69->68, IAR 72->71; clang (50/63) is namespace-length-independent and unchanged. GCC 68 matches the pre-1.1.10 value for a 6-char namespace. Verified: full ctest suite 68/68 on GCC (C++17); MSVC type_traits passes under msvc-wine (and fails at offset 65, confirming 64). Added a comment so the offsets are re-tuned on future namespace-length changes. Fixes CI on PR boost-ext#708 (ubuntu g++, windows MSVC).
boost-ext#706 (sml::make_action<Deps...>, issue boost-ext#629) is now merged into master, so this rebases onto it and documents it: - CHANGELOG: add make_action to the 1.2.0 additions - user_guide: new 'make_action [utility]' reference section with a verified run-link - tutorial: note make_action in the guards/actions section - README: regenerate TOC (adds the make_action entry) Regenerate every Compiler Explorer link against the v1.2.0 header (inline namespace v1_2_0) and re-verify each compiles + runs at -std=c++14 on godbolt (arduino c++20); replace the stale v1_1_13-era links across examples/tutorial/user_guide/index/overview. Also fix a bug in gen_godbolt_links.sh exposed during regeneration: the config-macro hoist strip (#define BOOST_SML*) was applied to dispatch_table.hpp too, deleting its deliberate re-#define of BOOST_SML_DETAIL_REQUIRES (sml.hpp #undef's it before that point) and breaking the dispatch_table/sdl2 links. Strip only the sml.hpp include from dispatch_table.hpp; keep its #define/#undef. The standalone make_action link is now preserved across --insert re-runs.
4234f82 to
90a3c61
Compare
Replace the inlined-header Godbolt links with thin ones that keep the example source intact and pull the header via Compiler Explorer's client-side #include-from-URL feature: #include <https://raw.githubusercontent.com/boost-ext/sml/master/include/boost/sml.hpp> CE fetches and pastes the header in the browser when the link is opened (this is NOT resolved by the compile API, which is why links are validated by compiling the fully-inlined equivalent instead). Sources shrink from ~3600 lines to the example itself (hello_world 101 lines, 1 include). dispatch_table.hpp does a relative #include "boost/sml.hpp" that CE's fetcher cannot resolve, so for dispatch_table and sdl2 the small utility header is inlined with its own sml.hpp include rewritten to the URL form (still no 3600-line header). All 25 examples + 4 error demos + make_action validated via their fully-inlined equivalents (GCC 14.2, -std=c++14; arduino c++20) before linking. gen_godbolt_links.sh updated to emit the thin form.
In the spirit of boost-ext#697, add high-level comments explaining the v1.2.0 additions so contributors don't have to reverse-engineer them: - make_action / action_wrap — why generic/constrained callables need an explicit signature for function_traits to read (boost-ext#629) - clear_defer — counterpart to defer; clear the defer queue on scope exit (boost-ext#643) - explicit_deps policy + get_explicit_deps — why a dep reached only via a generic lambda is dropped from the pool, and how sml::deps<Ts...> widens it (boost-ext#437) - flush_queue (impl + public entry) — draining events queued after process_event returned, e.g. from an async back::process<> handle (boost-ext#456) Comments only; full suite 69/69 on GCC 14 (C++17).
kris-jusiak
pushed a commit
that referenced
this pull request
Jun 1, 2026
The v1.1.13 -> v1.2.0 inline-namespace rename (v1_1_13 -> v1_2_0) shortened the namespace string by one character. get_type_name() skips a hardcoded prefix length into __FUNCSIG__/__PRETTY_FUNCTION__, and that prefix includes the inline namespace on MSVC/GCC/IAR (clang elides it). The stale offsets made get_type_name<int>() return the wrong substring, failing test_type_traits (all compilers) and test_policies_logging (GCC). Adjust the affected offsets by -1: MSVC 65->64, GCC 69->68, IAR 72->71; clang (50/63) is namespace-length-independent and unchanged. GCC 68 matches the pre-1.1.10 value for a 6-char namespace. Verified: full ctest suite 68/68 on GCC (C++17); MSVC type_traits passes under msvc-wine (and fails at offset 65, confirming 64). Added a comment so the offsets are re-tuned on future namespace-length changes. Fixes CI on PR #708 (ubuntu g++, windows MSVC).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v1.2.0 — finalizes everything merged since
v1.1.13and prepares the tag.Why 1.2.0 (minor, not patch): this release introduces new public API
(
sm::flush_queue,sml::clear_defer,sml::deps<Ts...>,sml::make_action) andchanges observable behavior (empty-SM
sizeofunder #249), so it warrants a minorbump per semver.
Version bump (
:arrow_up: v1.2.0)BOOST_SML_VERSION1'1'13→1'2'0; inline namespacev1_1_13→v1_2_0CMakeLists.txtpackage version1.1.13→1.2.0doc/CHANGELOG.mdentry finalized as[1.2.0] - 2026-06-01; README TOC regeneratedget_type_nameoffsets retuned for the 1-char-shorter namespace (MSVC 65→64,GCC 69→68, IAR 72→71; clang elides the inline namespace so it is unchanged) — the
shortened namespace otherwise broke
test_type_traits/test_policies_logging.What's in the release
New API
sm::flush_queue()— drain pending queued events from async handlers (asio: events queued outside the originated action handler are never processed #456)sml::clear_deferaction — discard deferred events from a transition (Access to defer_queue #643)sml::deps<Ts...>policy — explicit pool dependencies for generic-lambda actions/guards (pool<...> not initialized with passed dependency #437)sml::make_action<Deps...>(f)— wrap a template/generic/constrained callable so its dependency/event types are deduced from the explicit<Deps...>(Actions can not use concepts / constrained auto parameters #629, merged via feat(#629): add sml::make_action<Deps...>(f) for template/constrained callable actions #706)Behavior changes
-O2); opt back in withBOOST_SML_CFG_ENABLE_MIN_SIZE.sizeof(sm)for an empty SM may change (Clang UBSan Violation (Insufficient object size) when compiled with-O2or above #249)any/_wildcard no longer fires when a composable sub-SM has terminated (Any state doesn't work correctly with nested sub-states #622)process(E{})events are now storable in the process queue (Template error when using unused event insml::back::process<>in action. #580)const State&now sees live pool state, not a stale copy (Guards' access to state data compiles nicely but doesn't follow principle of least surprise #530)Bug fixes
Template-depth,
-Wshadow,-Wextra-semi, UBSan, final-class, null-deref, double-pop, reserved-identifier and related fixes — full list: v1.1.13...v1.2.0Documentation
flush_queue,deps,defer/clear_defer,make_action, and theon_entry<_>/operator,limitations).sml.hppexplaining the new API —make_action/action_wrap,clear_defer, theexplicit_deps/depspolicy, andflush_queue— so the rationale and issue cross-references live next to the code. No functional change.![CPP]embed (plus a standalonemake_actionlink). Links use Compiler Explorer's client-side#include-from-URL so the editor shows the example itself (the header is fetched from the raw GitHub URL on open), rather than inlining ~3600 lines. Each was validated by compiling its fully-inlined equivalent (GCC 14.2,-std=c++14; arduino c++20; error demos compile-only, showing their diagnostic). Regenerable viadoc/scripts/gen_godbolt_links.sh.http://melpon.org/wandbox→https://wandbox.org/api/compile.json, drop the invalidboost-1.60option, supplydispatch_table.hpp, fix the footer link.Also: pre-existing broken doc links fixed
user_guide.md:example/action_guards.cpp→example/actions_guards.cpp(typo)user_guide.md:example/errors/not_*.cpp→test/ft/errors/not_*.cpp(directory doesn't exist)Post-merge
Tag
v1.2.0on the merge commit so thev1.1.13...v1.2.0changelog link resolves.